<?php 
defined('IN_TS') or die('Access Denied.');

include 'userinfo.php';

$page = isset($_GET['page']) ? intval($_GET['page']) : '1';
$url = tsUrl('user','event',array('id'=>$strUser['userid'],'page'=>''));
$lstart = $page*15-15;

$arrEvents = $new['user']->findAll('event_users',array(
	'userid'=>$strUser['userid'],'status'=>1,
),'addtime desc',null,$lstart.',15');


foreach($arrEvents as $key => $item){
	$event = aac('event')->getEventByEventid($item['eventid']);
	$arrEvent[]=$event;
	$arrEvent[$key]['user']=aac('user')->getOneUser($event['userid']);

}

$eventNum = $new['user']->findCount('event_users',array(
	'userid'=>$strUser['userid'],'status'=>1,
));
$pageUrl = pagination($eventNum, 15, $page, $url);

$title = $strUser['username'].'的活动';
include template('event');